<?php

namespace App\Admin\Grids;

use App\Admin\Actions\HospitalAppointVaccineDeleteAction;
use App\Admin\Repositories\ChildBigData;
use App\Models\HospitalUploadData;
use Dcat\Admin\Admin;
use Dcat\Admin\Widgets\Form;
use App\Admin\Field\IntervalWeekNum;
use App\Admin\Forms\HospitalAppointVaccineForm;
use App\Models\HospitalAppointInterval;
use App\Models\HospitalAppointIntervalNum;
use App\Hospital\Repositories\HospitalAppointVaccine;
use App\Models\Vaccine;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\GridAction;
use Dcat\Admin\Grid\LazyRenderable;
use Dcat\Admin\Grid\RowAction;
use Illuminate\Support\Facades\DB;

class SignChildBigDataGrid extends LazyRenderable
{
    public function grid(): Grid
    {
        $data = $this->payload;
        return Grid::make(null, function (Grid $grid) use($data){
            $grid->column('total','签约总数（包含非管辖）');
            $grid->column('admin_total','管辖总数');
            $grid->column('sign_admin_total','管辖签约数');
            $grid->column('sign_rate','管辖签约数');
            $grid->model()->setData($this->generate());
        });
    }
    /**
     * 生成假数据
     *
     * @return array
     */
    public function generate()
    {
        $data = [ [
            'total'=>10,
            'admin_total'=>20,
            'sign_admin_total'=>5,
            'sign_rate'=>"10%"
        ]];
        return $data;
    }
}
